﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Sharpmark.MarkTweet.Services.Twitter
{
    [CollectionDataContract(Name = "statuses", ItemName = "status", Namespace = "")]
    public class Statuses : List<Status> { }

    [DataContract(Name = "status", Namespace = "")]
    public class Status
    {
        public DateTime CreatedAt { get; set; }
        [DataMember(Name = "created_at")]
        private string CreatedAtRaw
        {
            get { return CreatedAt.ToRowString(); }
            set { CreatedAt = value.ToDateTime(); }
        }

        [DataMember(Name = "id")]
        public string Id { get; set; }

        [DataMember(Name = "text")]
        public string Text { get; set; }

        [DataMember(Name = "source")]
        public string Source { get; set; }

        public bool Truncated { get; set; }
        [DataMember(Name = "truncated")]
        private bool? TruncatedRaw
        {
            get { return Truncated; }
            set { Truncated = value ?? false; }
        }

        [DataMember(Name = "in_reply_to_status_id")]
        public string InReplyToStatusId { get; set; }

        [DataMember(Name = "in_reply_to_user_id")]
        public string InReplyToUserId { get; set; }

        public bool Favorited { get; set; }
        [DataMember(Name = "favorited")]
        private bool? FavoritedRaw
        {
            get { return Favorited; }
            set { Favorited = value ?? false; }
        }

        [DataMember(Name = "in_reply_to_screen_name")]
        public string InReplyToScreenName { get; set; }
    }

}
